﻿@{
    ViewBag.Title = "示范目的";
}

<div id="result">
    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%;padding:10px">
        <tr>
            <td class="purposetitle" width="95%">示范目的</td>
            @*<td id="trialPurpose"><span class="icon icon-down"></span></td>*@
        </tr>
        <tr style="margin-bottom:10px">
            <td class="purposedesc" colspan="2" id="Purpose"></td>
        </tr>
    </table>

    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%">
        <tr>
            <td class="purposetitle" width="95%">供试药剂</td>
            <td>@*<img src="~/Images/triangle.png" />*@</td>
        </tr>
        <tr style="margin-bottom:10px">
            <td class="purposedesc" colspan="2" id="Agentia"></td>
        </tr>
    </table>

    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%">
        <tr>
            <td class="purposetitle" width="95%">防除对象</td>
            <td>@*<img src="~/Images/triangle.png" />*@</td>
        </tr>
        <tr style="margin-bottom:10px">
            <td class="purposedesc" colspan="2" id="Object"></td>
        </tr>
    </table>
    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%">
        <tr>
            <td class="purposetitle" width="95%">季节</td>
            <td>@*<img src="~/Images/triangle.png" />*@</td>
        </tr>
        <tr style="margin-bottom:10px">
            <td class="purposedesc" colspan="2" id="CropCategory"></td>
        </tr>
    </table>

    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%;display:none">
        <tr>
            <td class="purposetitle" width="95%">作物品种</td>
            <td>@*<img src="~/Images/triangle.png" />*@</td>
        </tr>
        <tr style="margin-bottom:10px">
            <td class="purposedesc" colspan="2" id="SubCropCategory"></td>
        </tr>
    </table>

    <table style="margin-top:10px;color:#ffffff;border-bottom:1px solid #e5e5e5;width:100%">
        <tr>
            <td class="purposetitle" width="95%">示范方案</td>
            @*<td><img src="~/Images/triangle.png" /></td>*@
        </tr>
        <tr style="margin-bottom:10px;font-size:12px">
            <td class="purposedesc" colspan="2">
                <textarea id="Others" class="tabletextarea" readonly="readonly"></textarea>
            </td>
        </tr>
    </table>
</div>
<div id="noresult" style="display:none;margin-top:10px;font-size:20px">
    本实验由实验员创建，没有对应的实验方案.
</div>
<script>
    if('@Html.ViewData["TrialGuideID"]'>0){
        $.ajax({
            type:"get",
            url: fixUrl("api/Trial/GetTrialGuide"),
            data: { ID: '@Html.ViewData["TrialGuideID"]'},

            success:function(data){
                if(data==null){
                    $("#noresult").css("display","inline");
                    $("#result").css("display","none");

                }else{

                    $("#Purpose").text(data.Purpose);
                    $("#CropCategory").text(data.CropCategory);
                    $("#SubCropCategory").text(data.SubCropCategory);
                    $("#Others").text(FormatTextAreaValue(data.Others));
                    var text=document.getElementById("Others");
                    text.style.width='95%'
                    //text.style.height='auto';
                    //text.style.height=textscrollHeight+'px';
                    $("#Object").text(data.Object);
                    $("#ProductName").text(data.ProductName);
                    $("#Agentia").text(data.Agentia);
                }
            }
        })
    }else{
        $("#noresult").css("display","inline");
        $("#result").css("display","none");
    }


function init(){
    var text=document.getElementById("Others");
    text.style.width='95%'
    text.style.height='auto';
    text.style.height=text.scrollHeight+'px';
}
</script>